<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="pages"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ page isELIgnored="false"%>
<s:set name="longDateFormat"><s:text name="dateformat.long" /></s:set>

<c:if test="${item != null}">
	<div class="contentBox info">
		<div class="contentBoxHeader">&nbsp;</div>
		<div class="contentBoxContent">
			<div class="contentBoxContentIcon">&nbsp;</div>
			<div class="contentBoxContentText">
				<span class="username">${item.createdBy.userName}</span>
				<span class="date"><fmt:formatDate value="${item.createdAt}" pattern="${longDateFormat}" /></span>
				<span class="content">
					<b>${item.name}</b> 
					<br />
					<s:text name="project.item.status" />:
					<s:set name="statusLabel">${item.status.label}</s:set>
					<s:text name="%{statusLabel}" />
					<p>
						${item.description}
					</p>
					
					<s:text name="project.item.users" />:
					<c:forEach items="${item.users}" var="user" varStatus="status">
						${user.userName}${not status.last ? ', ':''}
					</c:forEach>
					<br />

					<s:text name="project.item.supervisor" />:
						${item.supervisor.userName}
					<br />

					<s:text name="project.item.categories" />:
					<c:forEach items="${item.categories}" var="category" varStatus="status">
						<s:set name="categoryLabel">${category.label}</s:set>
						<s:text name="%{categoryLabel}" />${not status.last ? ', ':''}
					</c:forEach>
				</span>
			</div>			
			<div class="globalWrap">&nbsp;</div>
		</div>
		<div class="contentBoxFooter">&nbsp;</div>
	</div>
</c:if>
<c:if test="${item == null}">
	<div class="contentBox error">
		<div class="contentBoxHeader">&nbsp;</div>
		<div class="contentBoxContent">
			<div class="contentBoxContentIcon">&nbsp;</div>
			<div class="contentBoxContentText">
				<span class="username">&nbsp;</span>
				<span class="date">&nbsp;</span>
				<span class="content">
					<s:text name="project.item.notFound" />
				</span>
			</div>			
			<div class="globalWrap">&nbsp;</div>
		</div>
		<div class="contentBoxFooter">&nbsp;</div>
	</div>
</c:if>



